package com.wyf.armessage

import android.os.Bundle
import android.support.v7.app.AppCompatActivity

class MainActivity : AppCompatActivity() {

    /**************************Fragment*************************************/
    enum class FragEnum {
        HomeFragment,
    }
    var fm = supportFragmentManager
    var homeFrag:HomeFragment?=null


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        switchFragment(FragEnum.HomeFragment)
    }

    fun switchFragment(frag: FragEnum){
        hideFrag()
        when (frag) {
           FragEnum.HomeFragment ->{
               homeFrag = HomeFragment().newInstance()
               fm.beginTransaction().add(R.id.main_content,homeFrag).commit()
           }
        }
    }

    fun hideFrag(){

    }
}
